package com.gree.scmservice.dao.saasDao;

import com.gree.common.entity.TablePageData;
import com.gree.framework.entity.SaasTenantAddon;
import com.gree.scmservice.entity.saas.SaasSite;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.pager.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by 180686 on 2021/10/21 14:28
 */

@Repository
public class SaasTenantAddonDao {

    @Autowired
    private Dao dao;

    public SaasTenantAddon insertSaasTenantAddon(SaasTenantAddon saasTenantAddon){
        SaasTenantAddon insert = dao.insert(saasTenantAddon);
        return insert;
    }

    public int deleteSaasTenantAddon(String tenantId){
        int delete = dao.clear(SaasTenantAddon.class, Cnd.where("tenant_id", "=", tenantId));
        return delete;
    }

    public int updateSaasTenantAddon(SaasTenantAddon saasTenantAddon){
        int update = dao.update(saasTenantAddon);
        return update;
    }

    public SaasTenantAddon selectSaasTenantAddonById(String tenantId){
        SaasTenantAddon fetch = dao.fetch(SaasTenantAddon.class, tenantId);
        return fetch;
    }

}
